package com.cehome.cloudbox.exception;

import com.cehome.cloudbox.utils.I18nUtils;
import lombok.Data;

@Data
public class BizException extends RuntimeException {
    private String code;
    private String message;
    private Object[] args;

    public BizException(String code) {
        this.code = code;
    }

    public BizException(String code, Object... args) {
        this.code = code;
        this.args = args;
    }

    public BizException(Throwable e, String code) {
        super(I18nUtils.message(code, new Object[0]), e);
    }

    public BizException(Throwable e, String code, String... args) {
        super(I18nUtils.message(code, args), e);
    }
}
